//
//  HJComposeButton.swift
//  HJWeiBo
//
//  Created by 夏航军 on 16/10/6.
//  Copyright © 2016年 夏航军. All rights reserved.
//

import UIKit
let composeBtnW : CGFloat = 80
let composeBtnH: CGFloat = 110

class HJComposeButton: UIButton {
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        //设置基本属性
        titleLabel?.textAlignment = .center
        titleLabel?.font = UIFont.systemFont(ofSize: 15)
        setTitleColor(UIColor.darkGray, for: .normal)
        
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    //图片
    override func imageRect(forContentRect contentRect: CGRect) -> CGRect {
         return CGRect(x: 0, y: 0, width: composeBtnW, height: composeBtnW)
    }

    //文字
    override func titleRect(forContentRect contentRect: CGRect) -> CGRect {
        return CGRect(x: 0, y: composeBtnW, width: composeBtnW, height: composeBtnH - composeBtnW)
    }
    
}
